package com.example.flight.dao;

import com.example.flight.entity.FlightInformationEntity;
import com.example.flight.entity.OrderEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * 
 * 
 * @author hws
 * @email 231884142@qq.com
 * @date 2023-06-12 13:59:24
 */
@Mapper
public interface OrderDao extends BaseMapper<OrderEntity> {
  /*  @Select("select * from tb_order where uid=#{uid}")
    @Results(
            {
                    @Result(column = "oid",property ="oid"),
                    @Result(column = "uid",property ="uid"),
                    @Result(column = "class_type",property ="classType"),
                    @Result(column = "identity_number",property ="identityNumber"),
                    @Result(column = "name",property ="name"),
                    @Result(column = "price",property ="price"),
                    @Result(column = "create_time",property ="createTime"),
                    @Result(column = "fid",property ="fid"),
                    @Result(column = "fid",property ="flightInformation",
                            javaType = FlightInformationEntity.class,
                            one = @One(select = "com.example.flight.dao.FlightInformationDao.selectById")
                    ),
            }
    )
    List<OrderEntity> selectOrderByUid(String uid);
    @Select("select * from tb_order where identity_number=#{identityNumber}")
    @Results(
            {
                    @Result(column = "oid",property ="oid"),
                    @Result(column = "uid",property ="uid"),
                    @Result(column = "class_type",property ="classType"),
                    @Result(column = "identity_number",property ="identityNumber"),
                    @Result(column = "name",property ="name"),
                    @Result(column = "price",property ="price"),
                    @Result(column = "create_time",property ="createTime"),
                    @Result(column = "fid",property ="fid"),
                    @Result(column = "fid",property ="flightInformation",
                            javaType = FlightInformationEntity.class,
                            one = @One(select = "com.example.flight.dao.FlightInformationDao.selectById")
                    ),
            }
    )
    List<OrderEntity> selectOrderByIDNum(String identityNumber);*/
}
